# -*- coding: utf-8 -*-
from flask import Flask
from config import config


def create_app(config_name):

    # create the app

    app = Flask(__name__)
    app.config.from_object(config[config_name])
    config[config_name].init_app(app)
    from .main import main as main_blueprint
    app.register_blueprint(main_blueprint)
    from .remark import remark as remark_blueprint
    app.register_blueprint(remark_blueprint, url_prefix='/remark')
    from .hostel import hostel as hostel_blueprint
    app.register_blueprint(hostel_blueprint,url_prefix='/hostel')
    return app
